<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .main {
        width: 500px;
        height: 500px;
        background-color: yellowgreen;
        /* display: flex;
        justify-content: center;
        align-items: center; */
    }
    .box {
        max-width: 100%;
        height: 100%;
        animation: clip 5s linear infinite;
        -webkit-animation: clip 5s linear infinite;
        /* clip-path:polygon(100px 200px,100px 300px,200px 300px,200px 200px,);
        -webkit-clip-path:polygon(100px 200px,100px 300px,200px 300px,200px 200px,); */
        background-color: red;
    }
    @keyframes clip {
        0% { clip-path:polygon(100px 200px,100px 300px,200px 300px,200px 200px,);
            -webkit-clip-path:polygon(100px 200px,100px 300px,200px 300px,200px 200px,);}

        50% { clip-path:polygon(50px 250px,150px 350px,250px 250px,150px 150px);
            -webkit-clip-path:polygon(50px 250px,150px 350px,250px 250px,150px 150px);}

        100% { clip-path:polygon(100px 200px,100px 300px,200px 300px,200px 200px);
            -webkit-clip-path:polygon(100px 200px,100px 300px,200px 300px,200px 200px);}
    }
</style>
<body>
    <div class="main">
        <div class="box"></div>
    </div>
</body>
</html>